package com.itany.corejava.day14;

import java.io.FileReader;
import java.io.IOException;

public class TestFileReader {


    public static void main(String[] args) {

        FileReader fr=null;

        try{

            fr=new FileReader("d:/a.txt");

            System.out.println(fr.getEncoding());

            char[] c=new char[1000];

            int n;

            while((n=fr.read(c))!=-1){
                System.out.print(new String(c,0,n));
            }


        }catch (Exception e){
            e.printStackTrace();
        }finally{
            if(fr!=null){
                try {
                    fr.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }


    }


}
